//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "UI/Types/Types.h"

namespace Engine
{
namespace UI
{


	//
	// Color Style
	//

	struct ColorStyle
	{
	// types
	public:
		enum EType
		{
			IDLE	= 0,
			CHECKED,
			DISABLED,
			IDLE_PRESSED,
			CHECKED_PRESSED,
			_COUNT
		};

	private:
		typedef static_array< color4u, _COUNT >		color_array_t;


	// variables
	private:
		color_array_t	_colors;


	// methods
	public:
		ColorStyle ()
		{
			MemSet( _colors.ptr(), _colors.Count(), color4u(255) );
		}

		void Set (const color4u &color)
		{
			FOR( i, _colors ) {
				_colors[i] = color;
			}
		}

		color4u const &	Idle ()				const	{ return _colors[IDLE]; }
		color4u &		Idle ()						{ return _colors[IDLE]; }

		color4u const &	Disabled ()			const	{ return _colors[DISABLED]; }
		color4u &		Disabled ()					{ return _colors[DISABLED]; }

		color4u const &	Checked ()			const	{ return _colors[CHECKED]; }
		color4u &		Checked ()					{ return _colors[CHECKED]; }

		color4u const &	IdlePressed ()		const	{ return _colors[IDLE_PRESSED]; }
		color4u &		IdlePressed ()				{ return _colors[IDLE_PRESSED]; }

		color4u const &	CheckedPressed ()	const	{ return _colors[CHECKED_PRESSED]; }
		color4u &		CheckedPressed ()			{ return _colors[CHECKED_PRESSED]; }

		color4u &		operator [] (uint i)		{ return _colors[i]; }
		color4u const &	operator [] (uint i) const	{ return _colors[i]; }
	};


}	// UI
}	// Engine